package com.macro.mall.wx.domain;

import com.alibaba.fastjson.JSON;
import com.macro.mall.wx.sdk.WxMyConfig;
import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 微信付款入参
 */
public class WxPayDTO {
    /**
     * ip地址
     */
    private String spbill_create_ip;
    /**
     * 用户id
     */
    private  String openid;
    /**
     * 订单号
     */
    private String out_trade_no;
    /**
     * 金额-单位分
     */
    private String total_fee;
    /**
     * 商品名称
     */
    private String body;
    /**
     * 付款类型
     */
    private String trade_type;
    /**
     * 场景信息
     */
    private String scene_info;

    public WxPayDTO(WxMyConfig.TRADE_TYPE trade_type) {
        this.trade_type = trade_type.VALUE();
        if(WxMyConfig.TRADE_TYPE.MWEB.equals(trade_type)){
            scene_info = JSON.toJSONString(new H5Scene().wapPay());
        }
    }

    public String getSpbill_create_ip() {
        return spbill_create_ip;
    }

    public void setSpbill_create_ip(String spbill_create_ip) {
        this.spbill_create_ip = spbill_create_ip;
    }

    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    public String getOut_trade_no() {
        return out_trade_no;
    }

    public void setOut_trade_no(String out_trade_no) {
        this.out_trade_no = out_trade_no;
    }

    public String getTotal_fee() {
        return total_fee;
    }

    public void setTotal_fee(String total_fee) {
        this.total_fee = total_fee;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    public String getTrade_type() {
        return trade_type;
    }

    public void setTrade_type(String trade_type) {
        this.trade_type = trade_type;
    }

    public String getScene_info() {
        return scene_info;
    }

    public void setScene_info(String scene_info) {
        this.scene_info = scene_info;
    }



}
